package com.kaifamiao.buffer;

public class StringBufferTest5 {

	public static void main(String[] args) {
		
		StringBuffer buffer = new StringBuffer( "kaifamiao" );
		System.out.println( System.identityHashCode( buffer ) );
		
		StringBuilder builder = new StringBuilder( "kaifamiao" );
		System.out.println( System.identityHashCode( builder ) );
		
		// System.out.println( buffer.equals( builder ) ); // false 
		// System.out.println( builder.equals( buffer ) ); // false 
		
		String str = buffer.toString();
		// 借助于String提供的支持来比较
		System.out.println( str.contentEquals( builder ) ); // true
		
	}

}
